<?php

require_once(dirname(__FILE__)."/config.php");
require_once(DEDEINC."/oxwindow.class.php");
if(empty($dopost)) $dopost = '';
if(empty($fmdo)) $fmdo = '';
$ENV_GOBACK_URL = isset($_COOKIE['ENV_GOBACK_URL']) ? 'member_tixian.php' : '';
/*----------------
删除记录
----------------*/
if($dopost=="deltx")
{
    CheckPurview('tixian_Del');
    if($fmdo=='yes')
    {
        $id = preg_replace("#[^0-9]#", '', $id);
        if(!empty($id))
        {
                $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_paylist` WHERE id='$id' LIMIT 1");
        }
        ShowMsg("成功删除一条记录！",$ENV_GOBACK_URL);
        exit();
    }
    $wintitle = "提现申请-删除记录";
    $wecome_info = "<a href='".$ENV_GOBACK_URL."'>提现申请</a>::删除记录";
    $win = new OxWindow();
    $win->Init("member_tixian_do.php","js/blank.js","POST");
    $win->AddHidden("fmdo","yes");
    $win->AddHidden("dopost",$dopost);
    $win->AddHidden("id",$id);
    $win->AddTitle("你确实要删除(ID:".$id.")这条记录?");
    $winform = $win->GetWindow("ok");
    $win->Display();
}else if($dopost=="deltxs"){
    CheckPurview('tixian_Del');
    if($fmdo=='yes')
    {
        if(!empty($id))
        {            
                $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_paylist` WHERE id IN (".str_replace("`",",",$id).") ");
        }
        ShowMsg("成功删除这些记录！",$ENV_GOBACK_URL);
        exit();
    }
    $wintitle = "提现申请-删除记录";
    $wecome_info = "<a href='".$ENV_GOBACK_URL."'>提现申请</a>::删除记录";
    $win = new OxWindow();
    $win->Init("member_tixian_do.php", "js/blank.js", "POST");
    $win->AddHidden("fmdo", "yes");
    $win->AddHidden("dopost", $dopost);
    $win->AddHidden("id",$id);
    $win->AddTitle("你确实要删除(ID:".$id.")这条记录?");
    $winform = $win->GetWindow("ok");
    $win->Display();
}
else if ($dopost=="gxtx")
{
    CheckPurview('tixian_Edit');
    $id = preg_replace("#[^0-9]#", "", $id);
	$mid = preg_replace("#[^0-9]#", "", $mid);
        $dsql->ExecuteNoneQuery("UPDATE `#@__member_paylist` SET sta=1 WHERE id='$id' LIMIT 1");
		$dsql->ExecuteNoneQuery("UPDATE `#@__member` SET money=money-$money WHERE mid='$mid'");
        ShowMsg("更新提现成功！",$ENV_GOBACK_URL);
        exit();
}